#pragma once
#include<iostream>
#include"comm.hpp"

//模拟服务器发送数据

class client
{
public:
    client()
    {
    }
    bool openfile()
    {
        int n = comm_openfile(_fp,O_WRONLY);
        if(n < 0)
        {
            return false;
        }
        return true;
    }
    //写字符串
    int  write_s(std::string& cur)
    {
        return  ::write(_fp,cur.c_str(),cur.size());
    }
    void closefile()
    {
        comm_closefile(_fp);
    }
private:
    int _fp;
};